recursive training of models